import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login'
import Main from '@/views/Main'
import Home from '@/views/Home'
Vue.use(Router)

export default new Router({
	routes: [{
		path: '/login',
		name: 'Login',
		component: Login
	}, {
		path: '/',
		name: 'Home',
		component: Main,
		redirect: {
			path: '/home'
		},
		children: [{
				path: '/home',
				name: '首页',
				component: Home
			},
			{
				name: '添加用户',
				path: '/role',
				component: resolve => require(['../views/setting/adduser.vue'], resolve),
			},
			{
				name: '修改密码',
				path: '/changepassword',
				component: resolve => require(['../views/setting/changepassword.vue'], resolve),
			},
			{
				name: '添加角色',
				path: '/addpersonal',
				component: resolve => require(['../views/setting/addroles.vue'], resolve),
			 },
			 {
				name: '添加分类地区',
				path: '/addFL',
				component: resolve => require(['../views/upload/addFL.vue'], resolve),
			 },
			 {
				name: '添加分类类型',
				path: '/addTYPE',
				component: resolve => require(['../views/upload/addTYPE.vue'], resolve),
			 },
			 {
				name: '上传轮播图片',
				path: '/uploadSwiperimg',
				component: resolve => require(['../views/upload/uploadSwiperimg.vue'], resolve),
			},
			 {
				name: '上传封面图片',
				path: '/uploadimg',
				component: resolve => require(['../views/upload/uploadimg.vue'], resolve),
			},
			{
				name: '上传视频',
				path: '/uploadvideo',
				component: resolve => require(['../views/upload/uploadvideo.vue'], resolve),
			},
			{
				name: '电影资源信息列表',
				path: '/moivesourcelist',
				component: resolve => require(['../views/upload/moivesourcelist.vue'], resolve),
			},
			{
				name: '电视剧资源信息列表',
				path: '/tvsourcelist',
				component: resolve => require(['../views/upload/tvsourcelist.vue'], resolve),
			},
			{
				name: '管理视频资源列表',
				path: '/managerSourcelist',
				component: resolve => require(['../views/upload/managerSourcelist.vue'], resolve),
			},
			{
				name: '用户列表',  
				path: '/userlist',
				component: resolve => require(['../views/user/userlist.vue'], resolve),
			},
			{
				name: '提现列表',  
				path: '/withdraw',
				component: resolve => require(['../views/user/withdraw.vue'], resolve),
			},
			 {
				name: '图标',
				path: '/icon',
				component: resolve => require(['../views/icon/icon.vue'], resolve),
			},
			{
				name: '表格',
				path: '/table',
				component: resolve => require(['../views/table/table.vue'], resolve),
			},
			{
				name: '表单',
				path: '/form',
				component: resolve => require(['../views/form/form.vue'], resolve),
			},
		]
	}, {
		path: '*',
		redirect: {
			path: '/404'
		}
	}]
})